function dist = calculateDistance(chromo1, chromo2)
    [map1, ~] = find(chromo1);
    [map2, ~] = find(chromo2);
    M = length(map1);
    disagreement = 0;
    total = 0;
    for i = 1:M
        for j = i+1:M
            same1 = (map1(i) == map1(j));
            same2 = (map2(i) == map2(j));
            if same1 ~= same2
                disagreement = disagreement + 1;
            end
            total = total + 1;
        end
    end
    dist = disagreement / total;  % 归一化后的结构差异
end
